package com.itboye.mengwu.data.presenter;

import java.util.List;
import java.util.Observer;

import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.object.BasePresenter;
import com.itboye.core.object.ResultEntity;
import com.itboye.mengwu.app.ui.main.MainPresenter;
import com.itboye.mengwu.data.interfaces.INewMaMaZeng;
import com.itboye.mengwu.data.model.NewMaMaZengBean;
import com.itboye.mengwu.data.repository.NewMaMaZengRepository;

public class NewMaMaZengPresenter extends BasePresenter implements INewMaMaZeng<NewMaMaZengBean> {

	// 18 赠无限

	// 18.1 发布
	public static final String FabuSuccess = MainPresenter.class.getName() + "_Fabu_success";
	public static final String FabuFail = MainPresenter.class.getName() + "_Fabu_failure";
	// 18.2 收藏
	public static final String ShoucangSuccess = MainPresenter.class.getName() + "_Shoucang_success";
	public static final String ShoucangFail = MainPresenter.class.getName() + "_Shoucang_failure";
	// 18.3 列表 - 分页
	public static final String LiebiaofenyeSuccess = MainPresenter.class.getName() + "_Liebiaofenye_success";
	public static final String LiebiaofenyeFail = MainPresenter.class.getName() + "_Liebiaofenye_failure";
	// 18.5 申请
	public static final String ShenqingSuccess = MainPresenter.class.getName() + "_Shenqing_success";
	public static final String ShenqingFail = MainPresenter.class.getName() + "_Shenqing_failure";
	// 18.4 详情
	public static final String XiangqingSuccess = MainPresenter.class.getName() + "_Xiangqing_success";
	public static final String XiangqingFail = MainPresenter.class.getName() + "_Xiangqing_failure";
	// 18.6 申请 - 分页
	public static final String ShenqingfenyeSuccess = MainPresenter.class.getName() + "_Shenqingfenye_success";
	public static final String ShenqingfenyeFail = MainPresenter.class.getName() + "_Shenqingfenye_failure";
	// 18.7 赠送 - 选择
	public static final String ZengsongxuanzeSuccess = MainPresenter.class.getName() + "_Zengsongxuanze_success";
	public static final String ZengsongxuanzeFail = MainPresenter.class.getName() + "_Zengsongxuanze_failure";
	// 18.8 发货
	public static final String FahuoSuccess = MainPresenter.class.getName() + "_Fahuo_success";
	public static final String FahuoFail = MainPresenter.class.getName() + "_Fahuo_failure";
	// 18.9 评价
	public static final String PingjiaSuccess = MainPresenter.class.getName() + "_Pingjia_success";
	public static final String PingjiaFail = MainPresenter.class.getName() + "_Pingjia_failure";
	// 18.10 收藏 - 分页
	public static final String ShoucangfenyeSuccess = MainPresenter.class.getName() + "_Shoucangfenye_success";
	public static final String ShoucangfenyeFail = MainPresenter.class.getName() + "_Shoucangfenye_failure";
	// 18.11 类目 - 不分页
	public static final String LeimubufenyeSuccess = MainPresenter.class.getName() + "_Leimubufenye_success";
	public static final String LeimubufenyeFail = MainPresenter.class.getName() + "_Leimubufenye_failure";

	public NewMaMaZengPresenter(Observer observer) {
		super(observer);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void add(NewMaMaZengBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void delete(NewMaMaZengBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(NewMaMaZengBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void getInfo(NewMaMaZengBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public List<NewMaMaZengBean> queryYouHuiQuan(NewMaMaZengBean model) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void fabu(String uid, String title, String message, String cate_id, String template, String show_imgs,
			String zone_id, String main_img) {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(FabuSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);

			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventType(FabuFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);

			}
		});
		newMaMaZeng.fabu(uid, title, message, cate_id, template, show_imgs, zone_id, main_img);
	}

	@Override
	public void shoucang(String pid, String uid, String favorite_value, String fav_type) {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(ShoucangSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventType(ShoucangFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}
		});
		newMaMaZeng.shoucang(pid, uid, favorite_value, fav_type);
	}

	@Override
	public void libiaofenye(String name, String cate_id, String page_no, String page_size, String order, String zone,
			String uid, String to_uid) {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(LiebiaofenyeSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventTag(LiebiaofenyeFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}
		});
		newMaMaZeng.libiaofenye(name, cate_id, page_no, page_size, order, zone, uid, to_uid);

	}

	@Override
	public void shenqing(String pid, String uid, String reason, String address_id) {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(ShenqingSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventTag(ShenqingFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}
		});
		newMaMaZeng.shenqing(pid, uid, reason, address_id);

	}

	@Override
	public void xiangqing(String pid, String uid, String page_size) {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(XiangqingSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventTag(XiangqingFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}
		});
		newMaMaZeng.xiangqing(pid, uid, page_size);

	}

	@Override
	public void shenqingfenye(String pid, String page_no, String page_size) {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(ShenqingfenyeSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventTag(ShenqingfenyeFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}
		});
		newMaMaZeng.shenqingfenye(pid, page_no, page_size);

	}

	@Override
	public void zengsongxuanze(String pid, String apply_id, String uid) {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(ZengsongxuanzeSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventTag(ZengsongxuanzeFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}
		});
		newMaMaZeng.zengsongxuanze(pid, apply_id, uid);

	}

	@Override
	public void fahuo(String uid, String pid, String express_no, String express_code) {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(FahuoSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventTag(FahuoFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}
		});
		newMaMaZeng.fahuo(uid, pid, express_no, express_code);

	}

	@Override
	public void pingjia(String uid, String pid, String content, String score1, String score2, String score3,
			String attachments,String send) {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(PingjiaSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventTag(PingjiaFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}
		});
		newMaMaZeng.pingjia(uid, pid, content, score1, score2, score3, attachments,send);

	}

	@Override
	public void shoucangfenye(String uid, String page_no, String page_size, String max_img) {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(ShoucangfenyeSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventTag(ShoucangfenyeFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}
		});
		newMaMaZeng.shoucangfenye(uid, page_no, page_size, max_img);

	}

	@Override
	public void leimubufenye() {
		INewMaMaZeng<NewMaMaZengBean> newMaMaZeng = new NewMaMaZengRepository(new ICompleteListener() {

			@Override
			public void success(ResultEntity result) {
				result.setEventTag(Tag_Success);
				result.setEventType(LeimubufenyeSuccess);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}

			@Override
			public void failure(ResultEntity result) {
				result.setEventTag(Tag_Error);
				result.setEventTag(LeimubufenyeFail);
				NewMaMaZengPresenter.this.setChanged();
				NewMaMaZengPresenter.this.notifyObservers(result);
			}
		});
		newMaMaZeng.leimubufenye();

	}

}
